package com.yanboo.common.base;


import lombok.Builder;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Collection;

/**
 * 接口统一返回类型
 * total非空时结果为分页
 * size非空时结果为列表
 * total和size都为空时接口返回一个对象
 * @param <E>
 */
@Data
@Accessors(chain = true)
@Builder
public class UnifyResult<E> {

    private Integer code;

    private String msg;

    private Collection<E> data;

    private Integer total;

    private Integer size;
}
